﻿using System;
using IceCS.DataStructure.Core.BinaryTree;
using IceCS.DataStructure.Helpers;

namespace IceCS.DataStructure.Cmd
{
    class Program
    {
        static void Main(string[] args)
        {
            var A = new BTreeNode<string>("A");
            var B = new BTreeNode<string>("B");
            var C = new BTreeNode<string>("C");
            var D = new BTreeNode<string>("D");
            var E = new BTreeNode<string>("E");
            var F = new BTreeNode<string>("F");
            var G = new BTreeNode<string>("G");
            var btree = new LinkBTree<string>();
            btree.Head = A;
            btree.InsertLeftChildNode(A, B);
            btree.InsertRightChildNode(A, C);
            btree.InsertLeftChildNode(B, D);
            btree.InsertRightChildNode(B, E);
            btree.InsertLeftChildNode(C, F);
            btree.InsertLeftChildNode(D, G);
            btree.PreorderTraversal(btree.Head, n => Console.WriteLine(n.Data));

            //bool isOk = false;
            //if (!!!!!!!!!!!!!!!!!!!!!!
            //    !!!!            !!!!!!
            //    !!!!!!!!!  !!!!!!!!!!!
            //    !!!!            !!!!!!
            //    !!!!!!!!!  !!!!!!!!!!!
            //    !!!!!!!!!  !!!!!!!!!!!
            //    !!!!!!!!!  !!!!!!!!!!!
            //    !!!!!!!!!!!!!!!!!!!!!!!isOk) {
            //    Console.WriteLine("干");
            //}
        }

        static void TestSort()
        {
            var arr = new int[] { 70, 23, 45, 84, 12, 5, 75, 26, 88, 77, 99, 6, 7, 4, 5, 66, 25 };
            SortHelper.FastSort(arr);
        }
    }
}
